<%@page import="java.util.UUID"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp" %>
<%
    String uuid = UUID.randomUUID().toString();
    request.setAttribute("uuid", uuid);
%>
<form id="KBMSInfoSearch_${uuid}" style="display: none;" class="box-body form-float"></form>
<form id="KBMSAuditedSearch_${uuid}" style="display: none;" class="box-body form-float"></form>
<div class="row">
	<div class="col-md-3">
		<div class="box box-primary">
			<div class="box-header with-border">
				<div class="box-body">
					<div id="KBMSCategoryTree_${uuid}" class="ztree">
			   		</div>
				</div>
			</div>
		</div>
	</div>
	
	<div id="tab_${uuid}" class="col-md-9 ">
    	<div class="nav-tabs-custom">
    		<ul class="nav nav-tabs" role="tablist">
	    		<li class="active">
	    			<a href="#KBMSAuditTab_${uuid }" role="tab" data-toggle="tab">
	    			<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>待审核
	    			</a>
	    		</li>
	    		<li>
	    			<a href="#KBMSAuditedTab_${uuid }" role="tab" data-toggle="tab">
	    			<span class="glyphicon glyphicon-paperclip" aria-hidden="true"></span>已审核
	    			</a>
	    		</li>
	    	</ul>
	    	<div class="tab-content">
	    		<div role="tabpanel" class="tab-pane active" id="KBMSAuditTab_${uuid}">
	    	 		<div class="box-header with-border" id="KBMSInfoGridTb_${uuid}"></div>
			    	<div class="box-body">
						<table id="KBMSInfoGrid_${uuid}" style="width: 100%"></table>
					</div>
	    	 	</div>
	    	 	<div role="tabpanel" class="tab-pane" id="KBMSAuditedTab_${uuid}">
	    	 		<div class="box-header with-border" id="KBMSAuditedGridTb_${uuid}"></div>
			    	<div class="box-body">
						<table id="KBMSAuditedGrid_${uuid}"  style="width: 100%"></table>
					</div>
	    	 	</div>
	    	</div>
    	</div>
    </div>
</div>

<script type="text/javascript">
$(function(){
	var uuid = '${uuid}';
	requirejs(['wiseMen/dataModel/QueryDefTreeTpl','wiseMen/dataModel/QueryDefTpl'],function(QueryDefTreeTpl,QueryDefTpl){
		
		var catalogTree=new QueryDefTreeTpl({
			code:"KBMS_CATEGORY",
			modelCode:"KBMS_CATEGORY",
			model:"view",
			searchBarType:'dialog',
			treeDiv:"#KBMSCategoryTree_"+uuid,//grid表格
			displayName:'NAME',
			root:{
				NAME:'知识类别'
			},
			onSelect:function(row){
				var id='';
				if(row.ID!='-1'){
					id=row.ID;
				}else{
					id='';
				}
				KbmsInfoAuditGrid.search({
					CATEGORYID:id
				});
				KbmInfoAuditedGrid.search({
					CATEGORYID:id
				});
			}
		});
		
		var KbmsInfoAuditGrid=new QueryDefTpl({
			code:"KBMS_INFO_AUDIT",
			searchBarType:"dialog",
			queryDatas:{STATE:"'1'"},
			searchDiv:"#KBMSInfoSearch_"+uuid,//查询定义栏
			toolBarDiv:"#KBMSInfoGridTb_"+uuid,//工具栏定义栏
			gridDiv:"#KBMSInfoGrid_"+uuid//grid表格
		});
		
		var KbmInfoAuditedGrid=new QueryDefTpl({
			code:"KBMS_INFO_AUDITED",
			searchBarType:"dialog",
			queryDatas:{STATE:"'2','3'"},
			searchDiv:"#KBMSAuditedSearch_"+uuid,//查询定义栏
			toolBarDiv:"#KBMSAuditedGridTb_"+uuid,//工具栏定义栏
			gridDiv:"#KBMSAuditedGrid_"+uuid//grid表格
		});
	});
});
</script>